package com.health.user.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 药品生产厂家信息表
 * @TableName manufacturer
 */
@TableName(value ="manufacturer")
@Data
public class Manufacturer implements Serializable {
    /**
     * 主键ID
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 厂家名称
     */
    private String name;

    /**
     * 生产商账号
     */
    private String manufacturerAccount;

    /**
     * 药品生产厂家地址
     */
    private String manufacturerAddress;

    /**
     * 联系人
     */
    private String contactName;

    /**
     * 生产厂家联系电话
     */
    private String contactPhone;

    /**
     * 联系邮箱
     */
    private String email;

    /**
     * 联系地址
     */
    private String contactLocation;

    /**
     * 许可证号码
     */
    private String licenseNum;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 是否删除 0-未删除 1-删除
     */
    @TableLogic
    private Integer isDelete;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Manufacturer other = (Manufacturer) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getManufacturerAccount() == null ? other.getManufacturerAccount() == null : this.getManufacturerAccount().equals(other.getManufacturerAccount()))
            && (this.getManufacturerAddress() == null ? other.getManufacturerAddress() == null : this.getManufacturerAddress().equals(other.getManufacturerAddress()))
            && (this.getContactName() == null ? other.getContactName() == null : this.getContactName().equals(other.getContactName()))
            && (this.getContactPhone() == null ? other.getContactPhone() == null : this.getContactPhone().equals(other.getContactPhone()))
            && (this.getEmail() == null ? other.getEmail() == null : this.getEmail().equals(other.getEmail()))
            && (this.getContactLocation() == null ? other.getContactLocation() == null : this.getContactLocation().equals(other.getContactLocation()))
            && (this.getLicenseNum() == null ? other.getLicenseNum() == null : this.getLicenseNum().equals(other.getLicenseNum()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getIsDelete() == null ? other.getIsDelete() == null : this.getIsDelete().equals(other.getIsDelete()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getManufacturerAccount() == null) ? 0 : getManufacturerAccount().hashCode());
        result = prime * result + ((getManufacturerAddress() == null) ? 0 : getManufacturerAddress().hashCode());
        result = prime * result + ((getContactName() == null) ? 0 : getContactName().hashCode());
        result = prime * result + ((getContactPhone() == null) ? 0 : getContactPhone().hashCode());
        result = prime * result + ((getEmail() == null) ? 0 : getEmail().hashCode());
        result = prime * result + ((getContactLocation() == null) ? 0 : getContactLocation().hashCode());
        result = prime * result + ((getLicenseNum() == null) ? 0 : getLicenseNum().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getIsDelete() == null) ? 0 : getIsDelete().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", name=").append(name);
        sb.append(", manufacturerAccount=").append(manufacturerAccount);
        sb.append(", manufacturerAddress=").append(manufacturerAddress);
        sb.append(", contactName=").append(contactName);
        sb.append(", contactPhone=").append(contactPhone);
        sb.append(", email=").append(email);
        sb.append(", contactLocation=").append(contactLocation);
        sb.append(", licenseNum=").append(licenseNum);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", isDelete=").append(isDelete);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}